package org.annarborales.app;

import com.google.inject.Inject;

public class Hops {

	BrewingSystem brewingSystem;
	HopVariety hopVariety;

	@Inject
	public Hops(BrewingSystem brewingSystem, HopVariety hopVariety) {
		this.brewingSystem = brewingSystem;
		this.hopVariety = hopVariety;
	}

	public double calculateIBU(double percentUtilization) {

		double coefficient = 7489.0;
		double IBU = ((0.01 * hopVariety.getHBU())
				* (0.01 * hopVariety.getPercentUtilization()) * coefficient)
				/ (brewingSystem.getGravityCorrection() * brewingSystem
						.getFinishedBeerVolume());

		return IBU;
	}
}
